<?php
require_once("DBCommons.php");
if ($_GET['go']=="1") {

	$DBT=new MSDBTable("subcategories");
	$DBT->addIntField("IdSubcategory","IdSubcategory",-1,-1,false);
	$DBT->addVarcharField("Subcategory","Subcategory",-1,50);
	$DBT->addIntField("IdCategory","IdCategory",-1,50);
	$DBT->setPK("IdSubcategory");

	$tmp = &$DBT->addVarcharField("Email","E-Mail",-1,50,false);
	$tmp->addValidator(new MSDBValidator_Email());
	
	echo("<xmp>");
		$DBC=new MSDBCommon($_GET,$DBT);
		print_r($DBC->validateFieldsForInsert());
		print_r($DBC->validateFieldsForUpdate());
		echo($DBC->getInsertString());
		echo($DBC->getUpdateString());
	echo("</xmp>");
		
}

echo("<xmp>");
print_r($DBC->getEntity("users","idUser",6));
echo("</xmp>");
?>

<form action="" method="GET">
<input type="hidden" name="go" value="1">
IdSubcategory <input type="text" name="IdSubcategory" value="" maxlength="15"> <br />
Subcategory <input type="text" name="Subcategory" value="" maxlength="50"> <br />
IdCategory <input type="text" name="IdCategory" value="" maxlength="15"><br />
Email <input type="text" name="Email" value="" maxlength="50"><br />
<input type="submit" value="test">
</form>
